package com.iot.redissonlock;

import com.iot.redissonlock.config.IotlockConfig;
import com.iot.redissonlock.core.BusinessKeyProvider;
import com.iot.redissonlock.core.IotlockAspectHandler;
import com.iot.redissonlock.core.LockInfoProvider;
import com.iot.redissonlock.lock.LockFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * 描述:适用于内部低版本spring mvc项目配置,redisson外化配置
 * @author: myx
 * @date: 2018/7/13
 * Copyright © 2018-hotpot. All rights reserved.
 */
@Configuration
@Import({IotlockAspectHandler.class})
public class IotlockConfiguration {
    @Bean
    public LockInfoProvider lockInfoProvider(){
        return new LockInfoProvider();
    }

    @Bean
    public BusinessKeyProvider businessKeyProvider(){
        return new BusinessKeyProvider();
    }

    @Bean
    public LockFactory lockFactory(){
        return new LockFactory();
    }
    @Bean
    public IotlockConfig klockConfig(){
        return new IotlockConfig();
    }
}
